Monday, November 28, 2005

2 projects and 2nd one is nunit task

I setup another project in my CCNET and the biggest problem I had was after adding a new project section to my ccnnet.config file I didn't restart the service to read it properly. Once that was done I was ready to go.
Here is is


<project>
<name>BrandedSite_Testing</name>
<webURL>http://localhost/ccnet-dashboard/?_action_ViewProjectReport=true&server=local&project=BrandedSite_Testing</webURL>
<triggers>
<intervalTrigger buildCondition="ForceBuild"/>
</triggers>

<labeller type="defaultlabeller">
<!-- this prefix should be changed to be the current year -->
<prefix>2005-</prefix>
<incrementOnFailure>true</incrementOnFailure>
</labeller>
<tasks>
<nunit>
<path>C:\Program Files\NUnit 2.2\bin\nunit-console.exe</path>
<assemblies>
<assembly>C:\MyProject\Testing\bin\Debug\Testing.dll</assembly>
</assemblies>
</nunit>
</tasks>

<publishers>
<xmllogger />

<email from="buildmaster@somewhere.com" mailhost="elsmail" includeDetails="TRUE">
<users>
<user name="J.R." group="admin" address="me@somewhere.com"/>
</users>
<groups>
<group name="developers" notification="change"/>
<group name="admin" notification="change"/>
</groups>
</email>

</publishers>

</project>

Monday, October 10, 2005

preventing timeout with CruiseControl.NET

I was running an ndoc ant task with cruise control. Since we don't have small classes and our solution is absolutely huge I could only create docs on some of our assemblies. I found a tag for CC.NET that would extend the timeout laps. Example code is below.
The key is the <buildTimeoutSeconds> tag when running the nant task. I basically doubled the time b/c I didn't want to bother it any further. Default is 600 seconds.


<nant>
<executable>C:\TDD\nant-0.85-rc3\bin\nant.exe</executable>
<buildFile>ndoc.build</buildFile>
<targetList>
<target>ndoc</target>
</targetList>
<buildTimeoutSeconds>1200</buildTimeoutSeconds>
</nant>

Friday, October 07, 2005

Nant and sequence numbers?

I would like to start using cc.net and nant to produce some unit tests. I'm workign on some additions to web services and want to do unit/functional testing. Each request we make for a new order we need a unique reference number. I wanted Nant to track a sequence number, i.e. xmlWS_UnitTest-1, -2, -3, etc...

Does anyone know how to have nant do that or come up with a series of targets for nant to do that?

Also, does anyone have any experience with using unit testing and web services. What I'm thinking of doing is creating a class (using C#) that inherits from nunit and having each class look for an xml file and sumbitting it to test that the order was placed. I know that's not really unit testing since I'm testing the entire process, it's more like functional testing but it should still be possible. If anyone has seen anyposts please let me know. Thanks?

using NDoc with CC.NET

Below is a copy of the ndoc.build file I created. This will look for a coulple dll's, not all of them yet since it's a large project, and makes html and a .chm file. I was just trying to get something simple started and this is the beginning of it. Since I had a difficult time figuring out everything and I really couldn't find any good examples I figured I'd post this to help out others.


<?xml version="1.0"?>
<project default="ndoc">
<property name="debug" value="true"/>
<property name="Source" value="C:\Source" />


<target name="ndoc" depends="">
<ndoc verbose="true">
<assemblies basedir="${Source}">
<include name="${Source}\BusinessObjects\bin\Debug\BusinessObjects.dll" />
<include name="${Source}\ValueObjects\bin\Debug\ValueObjects.dll" />

</assemblies>


<!--
<summaries basedir="${TDD.Build}">
<include name="NamespaceSummary.xml" />
</summaries>-->
<documenters>
<documenter name="MSDN">
<property name="OutputDirectory" value="${TDD.Build}\doc" />
<property name="HtmlHelpName" value="My Help" />
<property name="HtmlHelpCompilerFilename" value="hhc.exe" />
<property name="IncludeFavorites" value="False" />
<property name="Title" value="Documentation for my web site and Web Services" />
<property name="SplitTOCs" value="False" />
<property name="DefaulTOC" value="" />
<property name="ShowVisualBasic" value="True" />
<property name="ShowMissingSummaries" value="True" />
<property name="ShowMissingRemarks" value="True" />
<property name="ShowMissingParams" value="True" />
<property name="ShowMissingReturns" value="True" />
<property name="ShowMissingValues" value="True" />
<property name="DocumentInternals" value="False" />
<property name="DocumentProtected" value="True" />
<property name="DocumentPrivates" value="False" />
<property name="DocumentEmptyNamespaces" value="False" />
<property name="IncludeAssemblyVersion" value="False" />
<property name="CopyrightText" value="" />
<property name="CopyrightHref" value="" />
</documenter>
</documenters>
</ndoc>

</target>

</project>


Then what I do is I run the above .build file from within my cruisecrontrol.net ccnet.config file using this

<nant>
<executable>C:\nant\bin\nant.exe</executable>
<buildFile>ndoc.build</buildFile>
<targetList>
<target>ndoc</target>
</targetList>
</nant>

Wednesday, October 05, 2005

Working FilterTrigger with CruiseControl.NET

I'm posting this since I haven't found an example online:
I have ccnet up and running but wanted to create a time it didn't run due to server reboots,etc...


The code below will do a build every 2 hours except from 11pm to 7am, every day of the week. It will force a build as well.

<triggers>
<filterTrigger startTime="23:00" stopTime="7:00">
<trigger type="intervalTrigger" buildCondition="ForceBuild" seconds="7200">
<weekDays>
<weekDay> Sunday </weekday>
...
...
</weekDay> Saturday </weekDay>
</filterTrigger>
</triggers>

Enjoy!!!!

Update on emailing CruiseControl.NET Setup and nant properties

I'm using CruiseContro.NET 0.92 and using nant-0.85-rc3. You can use rc2 but you don't get the nant timing report off the CC.NET dashboard if you don't use rc3.

Here are a couple hints from stuff I've learned. It doesn't look as if you can make a mybuild.properties file with Nant that you can with Ant. Instead you can go to the Nant/bin/ folder and look at the nant.exe.config file. There you will find a <properties> </properties> section. In there you can define global properties, such as VSS.Username in the format of

<properties>
<property name="VSS.Username" value="myusername">
<property name="VSS.PWD" value="mypassword">
</properties>

That way in any of your build scripts you can reference the ${VSS.Username} and you don't have to have that info repeated in your script at all, you define it once and that's it.

In my cruise.build (nant file) I have the property nant.onfailure defined so that it emails me but cruisecontrol.net also does that, so you don't have to define it in your nant file. If you want it in your nant file it can look like this:

<property name="nant.onfailure" value="buildFailed">
<target name="buildFailed" depends="">
<echo message="EMAILING NOW...">
<mail from="someEmail" tolist="myemailaddress" mailhost="smtpemail"
subject="Build Failed" message="The autobuild failed!" >
</mail>
</target>

You can define it within the ccnet.config as:

<publishers>
<xmllogger>
<email from="<a href=" from="myemail@mycompany.com">myemail@mycompany.com</a>" mailhost="smtpmail" includeDetails="true">
<users>
<user name="me" group="admin" address="<a href=">myemail@company.com</a>" />
</users>
<groups>
<group name="admin" notification="change">
</groups>
</email>
</publishers>

Friday, September 30, 2005

Automated Continuous Integration

Well I'm trying to setup an automated build and so far we are using VSS, C#.NET 2003 IDE and to automate I'm using Nant, NantContrib and CruiseControl.NET.

I've had some problems getting the Nant Solution target to work. We have a fairly large solution file and it's having problem loading the web project even though I have the web mappings in. I used this blog to start the process of setting up.

I ended up using the devenv to do the actual builds since the solution taks is giving me problems. Since my configuration name has spaces in it as well as the path to my solution I created a .bat file that runs the compilation of the solution and call that with an exec task. Then I 'll run a fxCop task which still needs to be cleaned up. I'll post later on some things I found, like if you use rc3 of nant and nantcontrib on cruisecontorl 0.92 you get to see the timings it took for nant to get files for SC and the time time it took to clean up folders, build code, etc..

Wednesday, July 20, 2005

First post at blogspot

Well I had my own site and posted there but with our move it hasn't been up and I've wanted to post on technical stuff so there will be new stuff to come!